package cn.edu.java.internet;

import java.io.IOException;
import java.net.URL;

public class URLClient {
    public static void main(String[] args) throws IOException {
        URL url = new URL("http://www.atguigu.com/index.shtml");

        System.out.println("getProtocol() :"+url.getProtocol());
        System.out.println("getHost() :"+url.getHost());
        System.out.println("getPort() :"+url.getPort());
        System.out.println("getPath() :"+url.getPath());
        System.out.println("getFile() :"+url.getFile());
        System.out.println("getQuery() :"+url.getQuery());

        System.out.println(url.getContent());
    }
}
